<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0">
		<title>Document</title>
		<link rel="stylesheet" href="../layui/css/layui.css">
		<link rel="stylesheet" type="text/css" href="../css/report.css">
	</head>
	<body>
		<header>
			<a href="javascript:history.back(-1)" class="back"><img src="../img/back.png" height="18px"></a>
			<div class="center title">举报</div>
		</header>
		<form action="">
		<div class="reason"></div>
		<div class="report">
			<div>辱骂<input type="radio" name="z_jbcontext" value="辱骂"></div>
			<div>色情<input type="radio" name="z_jbcontext" value="色情"></div>
			<div>广告<input type="radio" name="z_jbcontext" value="广告"></div>
			<div>违法行为（赌博、违禁品、反动等）<input type="radio" name="z_jbcontext" value="违法行为（赌博、违禁品、反动等）"></div>
		</div>
		<div class="confirm center"><input type="button" name="" value="举报"></div>
		</form>
	</body>
</html>
<script src="../js/jquery-3.3.1.js"></script>
<script src="../layui/layui.all.js"></script>
<script type="text/javascript">
	 function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
        }
        //接收URL中的参数id
        var z_u_bcount = getUrlParam('id');
        var type = getUrlParam('type');
        var z_u_count=localStorage.getItem('uCount')
        if(type=="data"){
        		$('.reason').html('请告诉我们你想举报该资料的理由');
        	}
        	if(type=="dynamic"){
        		$('.reason').html('请告诉我们你想举报该动态的理由');
        	}
        	if(type=="other"){
        		$('.reason').html('请告诉我们你想举报该用户的理由');
        	}

        $('.confirm').click(function(){
        	if(type=="data"){
        		var zType="资料举报";
        	}
        	if(type=="dynamic"){
        		var zType="动态举报";
        	}
        	if(type=="other"){
        		var zType="其他举报";
        	}
        	var z_jbcontext=$('input[name="z_jbcontext"]:checked').val();
        	$.post('/meiyou/jubao/insertJuBao',{
        		z_u_bcount:z_u_bcount,
        		z_jbcontext:z_jbcontext,
        		z_u_count:z_u_count,
        		zType:zType
        	},function(data){
        		if(data.code==100){
        			layer.msg(data.msg,{icon:6,time:800},function(){
        				window.location.reload();
        			});
        		}else{
        			layer.msg(data.msg,{iocn:5,time:800})
        		}
        	})
        });
</script>